package com.htfyun.eink.pw.draw.pen.epd.brush;


import com.htfyun.eink.pw.draw.pointer.PWPointer;

import java.util.ArrayList;
import java.util.List;

public class BrushParam {

    public boolean useFixedTimestampDiff = true;

    public float fixedTimestampDiff = 3;//offset_18
    public float pointFactor = 0.5f;//offset_20
    public float width;//config width * 2, offset_24
    public float sizeFactor = 1.0f;//offset_28
    public float timestampFactor = 0.01f;//offset_2C
    public float timestampDivisor = 16.0f;//offset_30
    public float velocityRatioLow = 0.95f;//offset_34
    public float velocityRatioHigh = 1.1f;//offset_38
    public float widthFactor = 0.02f;//offset_3C
    public float velocityPowFactory = 1.2f;//offset_40
    public float velocityExponent = 0.5f;//offset_44
    public float pressureExponent = 0.5f;//offset_0x50


    public boolean canDrawStroke;
    public long timestamp;
    public float sizeResult;
    public float sizeDiff = 0.0f;

    public float strokeWidth;

    public final List<PWPointer> validTouchPoints = new ArrayList<>();//offset_0x70, offset_0x78, offset_0x80

    public BrushParam() {
        setStrokeWidth(2.0f);
    }

    public BrushParam(float strokeWidth) {
        setStrokeWidth(strokeWidth);
    }

    public void setStrokeWidth(float strokeWidth) {
        this.strokeWidth = strokeWidth;
        this.width = strokeWidth * 2;
    }
}
